<template>
	<view class="success-pages" v-if="isLoad">
		<view class="flex-center icon-box">
			<image class="suc-img" :src="code == 0 ? `https://api.huixuananmm.com/admin/public/apply_suc.png` : `https://api.huixuananmm.com/admin/public/apply_fail.png`" mode="aspectFill"></image>
		</view>
		<view class="flex-center f-paragraph" :class="[{'c-warning':code != 0}]">{{ code == 0 ? '实名认证成功' : '实名认证失败'}}</view>
		<view class="flex-center success-btn-box">
			<view class="success-btn flex-center f-mini-title" :style="{border: `1px solid ${primaryColor}`,color: primaryColor}"
			@tap="toContract">去签署</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapMutations
	} from "vuex"
	import siteInfo from '@/siteinfo.js';
	export default {
		data() {
			return {
				options: {},
				loading: true,
				isLoad: false,
				code: 0
			}
		},
		computed: mapState({
			configInfo: state => state.config.configInfo,
		}),
		onLoad(options) {
			this.$util.showLoading()
			this.options = options
			console.log(options, '========> options')
			//this.$util.showLoading()
			this.initIndex()
			
		},
		methods: {
			...mapActions(['getConfigInfo']),
			async initIndex(refresh = false) {
				// #ifdef H5
				if (!refresh && this.$jweixin.isWechat()) {
					await this.$jweixin.initJssdk();
					this.$jweixin.wxReady(() => {
						this.$jweixin.hideOptionMenu()
					})
				}
				// #endif
				this.$util.setNavigationBarColor({
					bg: this.primaryColor
				})
				let h5faceId = this.$util.getQueryString('h5faceId')
				h5faceId = h5faceId.split('?')[0]
				let code = this.$util.getQueryString('code') || ''
				let param = {
					orderNo: this.$util.getQueryString('orderNo') || '',
					code,
					signature: this.$util.getQueryString('signature') || '',
					newSignature: this.$util.getQueryString('newSignature') || '',
					liveRate: this.$util.getQueryString('liveRate') || '',
					h5faceId
				}
				this.code = code
				this.isLoad = true
				await this.$api.technician.faceCallBack(param)
				this.$util.hideAll()
			},
			toContract(){
				// #ifdef H5
				this.$util.goUrl({url: `/technician/pages/mine`})
				// #endif
				// this.$util.goUrl({url: 3, openType: 'navigateBack'})
			}
		}
	}
</script>

<style lang="scss">
	.success-pages {
		.icon-box{
			padding-top: 127rpx;
			.suc-img{
				
			}
		}
		.success-btn-box{
			padding-top: 90rpx;
			.success-btn{
				width: 285rpx;
				height: 92rpx;
				border-radius: 92rpx;
				
			}
		}
	}
</style>
